USE [CMS]
GO

/****** Object:  Table [dbo].[Hours]    Script Date: 01/01/2013 15:12:15 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Hours](
	[ADM_ID] [bigint] NOT NULL,
	[HRS_ID] [bigint] IDENTITY(1,1) NOT NULL,
	[USR_ID] [bigint] NOT NULL,
	[HRS_COMPANYNAME] [varchar](350) NOT NULL,
	[HRS_DATE] [datetime] NULL,
	[HRS_WORKDAY] [varchar](100) NOT NULL,
	[HRS_PAYDAY] [datetime] NULL,
	[HRS_HOURS] [bigint] NOT NULL,
	[HRS_COMMENTS] [varchar](max) NULL,
	[MUT_DELETED] [datetime] NULL,
 CONSTRAINT [PK_Hours] PRIMARY KEY CLUSTERED 
(
	[HRS_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Hours]  WITH CHECK ADD  CONSTRAINT [FK_Hours_Administration] FOREIGN KEY([ADM_ID])
REFERENCES [dbo].[Administration] ([ADM_ID])
GO

ALTER TABLE [dbo].[Hours] CHECK CONSTRAINT [FK_Hours_Administration]
GO

ALTER TABLE [dbo].[Hours]  WITH CHECK ADD  CONSTRAINT [FK_Hours_Users] FOREIGN KEY([USR_ID])
REFERENCES [dbo].[Users] ([USR_ID])
GO

ALTER TABLE [dbo].[Hours] CHECK CONSTRAINT [FK_Hours_Users]
GO


